--LoginScene
--create by zouyb
--登陆场景

require "game/scene/SceneBase"
require "game/ui/form/login/UILogin"

local LoginScene = class("LoginScene",function()
    return SceneBase.new();
end)

function LoginScene.create()
    local scene = LoginScene.new();
    return scene;
end

function LoginScene:ctor()
    -- 怪物模型测试
    if true == TEST_MONSTER_MODEL or 1 == TEST_MONSTER_MODEL then
        require "game/ui/debug/UIMonsterDebug";
        local UIMonsterDebug = UIMonsterDebug.create();
        self:addForm(UIMonsterDebug);
        return;
    end

    -- 资源包下载测试
    if true == TEST_PKG_DOWNLOAD
        or 1 == TEST_PKG_DOWNLOAD
        or (_G["dislist"] and _G["dislist"]["test_pkg_download"] == 1) then
        require "game/ui/debug/UIPkgChecker";
        local uiChecker = UIPkgChecker.create();
        self:addForm(uiChecker);
        return;
    end

    -- 创建登录界面
    local uiLogin = UILogin.create();
    self:addForm(uiLogin);

    -- 播放背景音乐
    local bgm = AudioM.queryFormAudioInfo("UILogin", "open_bgm");
    AudioM.playBgMusic(bgm);

    -- 播放音效
    performWithDelay(self, function() AudioM.playFx("login2"); end, 0.1);
end

return LoginScene
